import typescript from 'rollup-plugin-typescript'
import dev  from 'rollup-plugin-dev'

const mode = process.env.NODE_ENV === 'development'

const config = {
    input: 'src/index.ts',
    output: {
        file: './dist/cv.js',
        format: 'esm'
    },
    plugins: [
        typescript()
    ]
}

if(mode){
    config.output.file = './dist/cv.dev.js'
    config.output.name = 'CV'
    config.output.format = 'umd'
    config.output.sourcemap = true
    config.plugins.push(
        dev({
            dirs: ['dist', 'src']
        })
    )
}

export default config